<!--
 * @Author: 宋杰
 * @Date: 2021-01-16 22:16:21
 * @LastEditors: Please set LastEditors
 * @LastEditTime: 2021-01-19 22:32:36
 * @Description: 一家十一口(猜一字)
-->
<template>
  <!-- <Card class="card-style"> -->
  <div id="secondright3" style="width:100%; height: 100%;"></div>
  <!-- </Card> -->
</template>

<script>
//import {} from '';
export default {
  name: "Secondright3",
  data() {
    return {
      chart: null,
      dataA: [120, 182, 321, 334, 260, 300],
      dataB: [190, 192, 191, 104, 250, 230],
    };
  },
  //监听属性 类似于data概念
  computed: {},
  //监控data中的数据变化
  watch: {},
  //生命周期 - 创建完成（可以访问当前this实例）
  created() {},
  //生命周期 - 挂载完成（可以访问DOM元素）
  mounted() {
    this.draw();
  },
  //方法集合
  methods: {
    draw() {
      this.chart = this.$echarts.init(document.getElementById("secondright3"));
      this.chart.setOption({
        color: ["#00e2ff", "#ff4e6f"],
        xAxis: {
          splitLine: {
            show: false,
          },
          type: "category",
          data: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"],
        },
        yAxis: {
          splitLine: {
            show: true,
            lineStyle: {
              color: "#081829",
            },
          },
					type: "value",
					name: "人数",
        },
        series: [
          {
            data: this.dataA,
            type: "line",
          },
          {
            data: this.dataB,
            type: "line",
          },
        ],
      });
    },
  },
  destroyed() {
    window.onresize = null;
  },
};
</script>
<style lang="scss" scoped></style>
